import { request } from "../utils/request";

export const requestLogin = params => {
  return request("/admin/user/login", params).then(data => {
    localStorage.setItem("user-token", JSON.stringify(data.data.token));
    return data;
  });
};

export const requestRegister = params => {
  return request("/api/user/register", params);
};

export const requestUserInfo = params => {
  return request("/admin/user/info/1", params).then(data => {
    sessionStorage.setItem("user-info", JSON.stringify(data));
    return data;
  });
};

export const requestUserList = params => {
  return request("/admin/user/list", params);
};
